import { getWeathers } from '@ray-js/ray';
import { getCachedLaunchOptions } from './getCachedLaunchOptions';

const devId = getCachedLaunchOptions().query.deviceId;

let cacheWeathers;

export const init = async () => {
  const weathers = await getWeathers({
    devId: devId,
    dataRange: 1,
  });

  cacheWeathers = weathers;

  return weathers;
};


export const getCacheWeathers = () => cacheWeathers;